export type GetContainer = () => HTMLElement

/** 解析容器, 返回如：document.body */
export function resolveContainer(getContainer: HTMLElement | GetContainer | undefined | null) {
  const container =
    typeof getContainer === 'function' ? (getContainer as GetContainer)() : getContainer
  return container || document.body
}
